package com.niiwoo.civet.account.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author Jaylin
 * @Date 2018-04-23
 * @Descript 资金冻结的订单类型枚举
 */
@Getter
@AllArgsConstructor
public enum FundsOrderTypeEnum {

    TYPE_INSTITUTIONAL_DEPOSIT((byte)1,"机构保证金"),
    TYPE_AGENCY_PERFORMANCE_INSURANCE((byte)2,"机构履约金"),
    ;

    private Byte type;
    private String typeDesc;

    public static FundsOrderTypeEnum typeOf(Byte type) {
        for (FundsOrderTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("为找到对应枚举，type=" + type);
    }
}
